package main
import "fmt"

func main(){
	//定义二维数组：
	var arr [2][2]int = [2][2]int{{1,2},{3,4}}
	fmt.Println(arr)
	fmt.Println("--------------------------")

	//方式1：普通for循环：
	for i :=0;i < len(arr);i ++{
		for _i :=0; _i < len(arr[i]);_i++{
			fmt.Printf("第%d行，第%d个值为：%d \n",i+1,_i+1,arr[i][_i])
		}
	}

	fmt.Println("--------------------------")

	//方式2：for range循环
	for k,v := range arr{
		for _k,_v := range v{
			fmt.Printf("第%d行，第%d个值为：%d \n",k+1,_k+1,_v)
		}
	}

	//99乘法表：
	var x_l [9]int16 = [9]int16{1,2,3,4,5,6,7,8,9}
	var y_l [9]int16 = [9]int16{1,2,3,4,5,6,7,8,9}

	for _,x := range x_l{
		for _,y := range  y_l{
			if(x >= y){
				fmt.Printf("%d * %d = %d  ",x,y,x*y)
			}
		}

		fmt.Println()
	}
}